<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
    <title>Document</title>
    <link rel="stylesheet" href="../css/playgame.css">
    <script type="text/javascript" src="http://zt.gzl.com.cn/subject/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../js/playgame.js"></script>
</head>
<body>
    <div class="playbox">
        <span id="startPlay" class="playgame"></span>
        <span class="regular"></span>
        <div class="regular-box">
            <h4>游戏规则</h4>
            <p>
                (1)游戏时间：限时30秒；<br/>
                (2)游戏小贴士：留意抓手摆动的方向，瞄准后点击屏幕爪取！<br/>
                (3)活动期间每人有3次游戏机会，分数＞15分即可获赠优惠券一张：<br/>　
                    <span>①计分区间达15分—24分，获20元优惠券；</span><br/>　
                    <span>②计分区间达25分—34分，获200元优惠券；</span><br/>　
                    <span>③计分35分以上，获200元优惠券；</span><br/>
            </p>
            <p class="tips">小贴士：机会太少？一键分享有惊喜！</p>
            <span class="close">关闭</span>
        </div>
        <div class="activityOut">
            <img class="activeTit" src="../images/overTips.png">
            <img class="activeClose" src="../images/close.png" alt="">
            <img class="goback" src="../images/goback.png" alt="">
        </div>
    </div>
    <script>
        $(document).ready(function(){
            // 自动
            $('.playgame').addClass('hover');
            let time = setTimeout(function(){
                $('.playgame').removeClass('hover');
            },700)

            //弹出规则
            $('.regular').click(function(){
                console.log('regular')
                $('.regular-box').show();
            })

            //关闭规则
            $('.close').click(function(){
                $(this).parent('div').hide();
            })

            // 活动结束弹框关闭
            $('.activeClose').click(function(){
                $(this).parent('.activityOut').hide();
            })

            $('.goback').click(function(){
                window.location.href = ""; //专题链接
            })

            $('#startPlay').click(function(){
                console.log(11)
                var isInTime = true;  //活动时间内
                var islogin = false;   //已登录
                if (isInTime) {
                    if (islogin) {
                        window.location.href = "http://10.1.43.17:3000/index.html";
                    }else{
                        window.location.href = "http://weixin.gzl.cn/discount/userdiscount.html";
                    }
                }else{
                    $('.activityOut').show();
                }
                
            })
            
        })
    </script>
</body>
</html>